<template>
  <div class="container">
    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
      <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
        <div
          ref="fresh"
          :style="{height:freshHeight +'px','overflow-y':'scroll','box-sizing': 'border-box','padding-bottom':'0.2rem'}"
        >
          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>

          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>

          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>

          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>

          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>

          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>

          <div class="pro">
            <div class="protitle">产品名称</div>
            <div>年利率</div>
            <div>
              <div>44.6%</div>
              <div>
                <van-button type="default" color="#DBB47F" class="btn">立即申请</van-button>
              </div>
            </div>
          </div>
        </div>
      </van-list>
    </van-pull-refresh>
  </div>
</template>
<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      freshHeight: "",
      loading: false,
      finished: false,
      refreshing: false
    };
  },
  methods: {
    onRefresh() {
  
      setTimeout(() => {
         console.log("onRefresh");
              this.loading =  true,
      this.finished =  true,
      this.refreshing = true
      }, 2000);
    },

    onLoad() {
     
    }
  },
  mounted() {
    window.document.title = "精选产品";
    //
    this.freshHeight =
      document.documentElement.clientHeight -
      this.$refs.fresh.getBoundingClientRect().top;
  }
};
</script>
<style scoped>
.container {
  width: 100%;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  background: #f6f5f5;
}
.pro {
  padding: 0.2rem;
  background: #fff;
  margin-bottom: 0.2rem;
}
.protitle {
  font-size: 0.4rem;
}
.pro div:nth-child(2) {
  font-size: 0.23rem;
  color: #999999;
  margin-top: 0.1rem;
}
.pro div:nth-child(3) {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.1rem;
}
.pro div:nth-child(3) div:nth-child(1) {
  font-size: 0.4rem;
  color: #dbb47f;
  /* #DBB47F */
}
.btn {
  width: 1.8rem;
  height: 0.7rem;
  line-height: 0.7rem;
}
</style>